import React, { Component } from 'react'
import { Router, Route, IndexRoute } from 'react-router'

import App from '../containers/App'
import Home from '../containers/Home'
import City from '../containers/City'
import Search from '../containers/Search'
import NotFound from '../containers/404'

class RouterMap extends Component{
  render() {
    return (
      <Router history={this.props.history}>
        <Route path="/" component={App}>
          <IndexRoute component={Home}/>
          <Route path='/city' component={City}/>
          <Route path='/search/:category(/:keyword)' component={Search}/>
          <Route path="*" component={NotFound}/>
        </Route>
      </Router>
    )
  }
}

export default RouterMap
